home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / terminal / top_152 / src152.exe / rar / TOPMRK.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-16  |  16KB  |  478 lines

  1. {┌─────────────────────────────────────────────────────────────────────────┐}
  2. {│                                                                         │}
  3. {│                              T. O. P.                                   │}
  4. {│                                                                         │}
  5. {│                        (T)he  (O)ther  (P)acket                         │}
  6. {│                                                                         │}
  7. {│ T O P M R K . P A S                                                     │}
  8. {│                                                                         │}
  9. {│                                                                         │}
  10. {│ Routinen zum Lesen und Schreiben des Merkerfiles  MERKER.TOP            │}
  11. {└─────────────────────────────────────────────────────────────────────────┘}
  12.  
  13.  
  14. Procedure Merker_Conn_Schreiben;
  15. var  i,i1 : Byte;
  16.      Flag : Boolean;
  17.  
  18. Begin
  19.   Flag := false;
  20.   for i := 1 to maxLink do with K[i]^ do if connected then
  21.   begin
  22.     if not Flag then
  23.     begin
  24.       Assign(G^.TFile,Sys1Pfad + ConDatei);
  25.       FiResult := RewriteTxt(G^.TFile);
  26.     end;
  27.     Flag := true;
  28.     Writeln(G^.TFile,LZ);
  29.     Writeln(G^.TFile,Rcon,i,MrkCALL,Call);
  30.     Writeln(G^.TFile,Rcon,i,MrkDATE,QSO_Date);
  31.     Writeln(G^.TFile,Rcon,i,MrkBEG,QSO_Begin);
  32.     i1 := pos(M1,ConText);
  33.     if i1 = 0 then G^.DZeile := ConText
  34.               else G^.DZeile := Copy(ConText,1,i1-1);
  35.     Writeln(G^.TFile,Rcon,i,MrkTEXT,G^.DZeile);
  36.     Writeln(G^.TFile,Rcon,i,MrkART,SysArt,Km,UserArt);
  37.   end;
  38.   if Flag then FiResult := CloseTxt(G^.TFile);
  39. End;
  40.  
  41.  
  42. Procedure Merker_Conn_Lesen;
  43. Var  i : Byte;
  44.  
  45.   Procedure ConRead(Fstr : str10);
  46.   var  Flag : Boolean;
  47.   Begin
  48.     Flag := false;
  49.     FiResult := ResetTxt(G^.TFile);
  50.     While not Flag and not Eof(G^.TFile) do
  51.     begin
  52.       Readln(G^.TFile,G^.DZeile);
  53.       if copy(G^.DZeile,1,length(Fstr)) = Fstr then
  54.       begin
  55.         Flag := true;
  56.         delete(G^.DZeile,1,pos(GL,G^.DZeile));
  57.         KillStartBlanks(G^.DZeile);
  58.         KillEndBlanks(G^.DZeile);
  59.       end;
  60.     end;
  61.     if not Flag then G^.DZeile := '';
  62.   End;
  63.  
  64. Begin
  65.   Assign(G^.TFile,Sys1Pfad + ConDatei);
  66.   if ResetTxt(G^.TFile) = 0 then
  67.   begin
  68.     for i := 1 to maxLink do with K[i]^ do
  69.     begin
  70.       ConRead(Rcon + int_str(i) + MrkCALL);
  71.       if G^.DZeile > '' then
  72.       begin
  73.         Call := G^.DZeile;
  74.         ConRead(Rcon + int_str(i) + MrkDATE);
  75.         if G^.DZeile > '' then QSO_Date := G^.DZeile;
  76.         ConRead(Rcon + int_str(i) + MrkBEG);
  77.         if G^.DZeile > '' then QSO_Begin := G^.DZeile;
  78.         ConRead(Rcon + int_str(i) + MrkTEXT);
  79.         if G^.DZeile > '' then ConText := G^.DZeile;
  80.         ConRead(Rcon + int_str(i) + MrkART);
  81.         if G^.DZeile > '' then
  82.         begin
  83.           SysArt := Byte(str_int(ParmStr(1,Km,G^.DZeile)));
  84.           UserArt := Byte(str_int(ParmStr(2,Km,G^.DZeile)));
  85.           if SysArt in [0..maxSCon] then SCon[SysArt] := true
  86.                                     else SysArt := 0;
  87.           if (SysArt = 11) and HoldDXc then
  88.           begin
  89.             G^.DZeile := HoldDXcStr;
  90.             Link_erhalter(i,G^.DZeile);
  91.             SetzeFlags(i);
  92.           end;
  93.           if not(UserArt in [1..maxUser]) then UserArt := 1;
  94.         end;
  95.         connected := true;
  96.       end;
  97.     end;
  98.     FiResult := CloseTxt(G^.TFile);
  99.   end;
  100. End;
  101.  
  102.  
  103. Procedure Merker_File_Schreiben;
  104. Var       i,i1  : Integer;
  105.           Kanal : Byte;
  106.           Hstr  : String[80];
  107.  
  108. Begin
  109.   Assign(G^.TFile,Sys1Pfad + MerkDatei);
  110.   if RewriteTxt(G^.TFile) = 0 then
  111.   Begin
  112.     Writeln(G^.TFile,LZ);
  113.     for i := 1 to maxTNC do if TNC_used[i] then with TNC[i]^ do
  114.     begin
  115.       if BText = '' then BText := 'CQ';
  116.       Writeln(G^.TFile,Rrtn,i,':BT=',BText);
  117.       if BPfad = '' then BPfad := 'ALL';
  118.       Writeln(G^.TFile,Rrtn,i,':BP=',BPfad);
  119.       if Bake then Write(G^.TFile,Rrtn,i,Rpar,GL,'1,')
  120.               else Write(G^.TFile,Rrtn,i,Rpar,GL,'0,');
  121.       Write(G^.TFile,BTimer,Km);
  122.       Write(G^.TFile,CText,Km);
  123.       Write(G^.TFile,Info,Km);
  124.       Write(G^.TFile,Aktuell,Km);
  125.       Write(G^.TFile,QText,Km);
  126.       Write(G^.TFile,Fix,Km);
  127.       Writeln(G^.TFile,QRG_Akt);
  128.     end else
  129.     begin
  130.       Writeln(G^.TFile,Rrtn,i,':BT=','CQ');
  131.       Writeln(G^.TFile,Rrtn,i,':BP=','ALL');
  132.       Writeln(G^.TFile,Rrtn,i,Rpar,GL,'0,20,1,1,1,1,1');
  133.     end;
  134.  
  135.     Writeln(G^.TFile,LZ);
  136.  
  137.     for Kanal := 0 to maxLink do
  138.     Begin
  139.       Writeln(G^.TFile,LZ);
  140.       with K[Kanal]^ do
  141.       begin
  142.         if Kanal > 0 then
  143.         begin
  144.           if OwnCall = '*' then OwnCall := TNC[TncNummer]^.HostCall;
  145.           Writeln(G^.TFile,Rrch,Kanal,':CALL=',OwnCall);
  146.           if AutoZyConst > 0 then
  147.              Writeln(G^.TFile,Rrch,Kanal,':AUTO=',AutoZyConst);
  148.         end;
  149.  
  150.         Writeln(G^.TFile,Rrch,Kanal,
  151.          Rpar + GL,MaxFrame,Km,PacLen,Km,ObStat,Km,UnStat,Km,UmlautMerk);
  152.  
  153.         if RX_Save then
  154.         begin
  155.           CloseRxFile(Kanal,1);
  156.           Writeln(G^.TFile,Rrch,Kanal,':RXS=',FRxName);
  157.           RX_Save := false;
  158.           RX_Bin := 0;
  159.         end;
  160.  
  161.         if Save then
  162.         begin
  163.           FiResult := CloseBin(SFile);
  164.           Writeln(G^.TFile,Rrch,Kanal,':SAV=',FName_aus_FVar(SFile));
  165.           Save := false;
  166.         end;
  167.  
  168.         if SPlus and SplSave then
  169.         begin
  170.           Writeln(G^.TFile,Rrch,Kanal,':7PL=',FName_aus_FVar(SplFile),' ',
  171.                   Spl_gLaenge,' ',Spl_gCount,' ',Spl_tLaenge,' ',Spl_tCount);
  172.           FiResult := CloseBin(SplFile);
  173.           SplSave := false;
  174.         end;
  175.  
  176.         Write(G^.TFile,Rrch,Kanal,':FLAG=');
  177.  
  178.         if Umlaut > 0 then     Write(G^.TFile,'U',Umlaut);
  179.         if Echo > 0 then       Write(G^.TFile,'E',Echo);
  180.         if not Gross then      Write(G^.TFile,'Y');
  181.  
  182.         if Kanal > 0 then
  183.         begin
  184.           if Auto then         Write(G^.TFile,'F');
  185.           if TopBox then       Write(G^.TFile,'M');
  186.           if Rx_Beep then      Write(G^.TFile,'∞');
  187.           if morsen then       Write(G^.TFile,'C');
  188.           if TxBeepAck then    Write(G^.TFile,'Q');
  189.           if Speek then        Write(G^.TFile,'P');
  190.           if AutoBin then      Write(G^.TFile,'$');
  191.           if SPlus then        Write(G^.TFile,'+');
  192.           if TxComp then       Write(G^.TFile,'°');
  193.           if RxComp then       Write(G^.TFile,'≈');
  194.           if NoCurJump then    Write(G^.TFile,'÷');
  195.         end else
  196.         begin
  197.           if Klingel then      Write(G^.TFile,'K');
  198.           if CtrlBeep then     Write(G^.TFile,'G');
  199.           if Time_stamp then   Write(G^.TFile,'T');
  200.           if PacOut then       Write(G^.TFile,'L');
  201.           if ZeigeRET then     Write(G^.TFile,'R');
  202.           if ConMorsen then    Write(G^.TFile,'O');
  203.           if ReconMorsen then  Write(G^.TFile,'D');
  204.           if ConVoice then     Write(G^.TFile,'A');
  205.           if ReconVoice then   Write(G^.TFile,'J');
  206.           if GlobalTrenn then  Write(G^.TFile,'H');
  207.           if BinOut then       Write(G^.TFile,'i');
  208.           if Ins then          Write(G^.TFile,'Z');
  209.           if NoBinMon then     Write(G^.TFile,'!');
  210.           if RX_TX_Win then    Write(G^.TFile,'&');
  211.         end;
  212.         Writeln(G^.TFile);
  213.       end;
  214.     end;
  215.     Writeln(G^.TFile,LZ);
  216.     Writeln(G^.TFile,LZ);
  217.  
  218.     Hstr := '';
  219.     for i := 1 to 10 do Hstr := Hstr + int_str(G^.SETL[i]) + Km;
  220.     Hstr := Hstr + int_str(SETNr);
  221.     Writeln(G^.TFile,Rrgl,Rsetl,GL,Hstr);
  222.  
  223.     if Idle_Pos then i := 1
  224.                 else i := 0;
  225.     Hstr := int_str(i) + Km + int_str(Idle_Anz) + Km + int_str(Idle_Tout);
  226.     Writeln(G^.TFile,Rrgl,Ridle,GL,Hstr);
  227.  
  228.     Writeln(G^.TFile,Rrgl,Rmfreq,GL,G^.TonHoehe);
  229.     if _VGA then i := 1
  230.             else i := 0;
  231.     Writeln(G^.TFile,Rrgl,Rega,GL,int_str(i));
  232.     Writeln(G^.TFile,Rrgl,Rplen,GL,MPause);
  233.     Writeln(G^.TFile,Rrgl,Rsynch,GL,Resync_Z);
  234.     Writeln(G^.TFile,Rrgl,Rcnr,GL,CNr);
  235.     Writeln(G^.TFile,Rrgl,Rvsp,GL,VSpeed);
  236.     Writeln(G^.TFile,Rrgl,Rinfo,GL,G^.InfoStr);
  237.     FiResult := CloseTxt(G^.TFile);
  238.   end;
  239. End;
  240.  
  241.  
  242. Procedure Merker_File_Lesen;
  243. Var     Result : Word;
  244.         Hstr   : String[10];
  245.         i,i1,
  246.         i2,C   : Integer;
  247.  
  248.   Procedure MerkRead(Fstr : Str10);
  249.   var  Flag : Boolean;
  250.   Begin
  251.     Flag := false;
  252.     FiResult := ResetTxt(G^.TFile);
  253.     While not Flag and not Eof(G^.TFile) do
  254.     begin
  255.       Readln(G^.TFile,G^.DZeile);
  256.       if copy(G^.DZeile,1,length(Fstr)) = Fstr then
  257.       begin
  258.         Flag := true;
  259.         delete(G^.DZeile,1,pos(GL,G^.DZeile));
  260.         KillStartBlanks(G^.DZeile);
  261.         KillEndBlanks(G^.DZeile);
  262.       end;
  263.     end;
  264.     if not Flag then G^.DZeile := '';
  265.   End;
  266.  
  267. Begin
  268.   Assign(G^.TFile,Sys1Pfad + MerkDatei);
  269.   if ResetTxt(G^.TFile) = 0 then
  270.   begin
  271.     WriteTxt(XCP,SZ1,StartColor,MerkDatei);
  272.     XCP := XCP + SZL;
  273.  
  274.     for i := 1 to TNC_Anzahl do with TNC[i]^ do
  275.     begin
  276.       MerkRead(Rrtn + int_str(i) + ':BT');
  277.       if G^.DZeile > '' then Btext := G^.DZeile;
  278.       MerkRead(Rrtn + int_str(i) + ':BP');
  279.       if G^.DZeile > '' then BPfad := G^.DZeile;
  280.       MerkRead(Rrtn + int_str(i) + Rpar);
  281.       if G^.DZeile > '' then
  282.       begin
  283.         Bake := ParmStr(1,Km,G^.DZeile) = '1';
  284.         BTimer := Word(str_int(ParmStr(2,Km,G^.DZeile)));
  285.         if BTimer = 0 then BTimer := 20;
  286.         CText := Byte(str_int(ParmStr(3,Km,G^.DZeile)));
  287.         Info := Byte(str_int(ParmStr(4,Km,G^.DZeile)));
  288.         Aktuell := Byte(str_int(ParmStr(5,Km,G^.DZeile)));
  289.         QText := Byte(str_int(ParmStr(6,Km,G^.DZeile)));
  290.         Fix := Byte(str_int(ParmStr(7,Km,G^.DZeile)));
  291.         QRG_Akt := ParmStr(8,Km,G^.DZeile);
  292.         if QRG_Akt = '' then QRG_Akt := PseudoQRG;
  293.       end;
  294.     end;
  295.  
  296.     for C := 0 to maxLink do
  297.     begin
  298.       with K[C]^ do
  299.       begin
  300.         if C > 0 then
  301.         begin
  302.           MerkRead(Rrch + int_str(C) + ':CALL');
  303.           if G^.DZeile > '' then OwnCall := G^.DZeile;
  304.           MerkRead(Rrch + int_str(C) + ':AUTO');
  305.           if G^.DZeile > '' then
  306.           begin
  307.             AutoZyConst := Word(str_int(G^.DZeile));
  308.             if AutoZyConst > 0 then CSelf := 2;
  309.           end;
  310.         end;
  311.  
  312.         MerkRead(Rrch + int_str(C) + Rpar);
  313.         if G^.DZeile > '' then
  314.         begin
  315.           MaxFrame := Byte(str_int(ParmStr(1,Km,G^.DZeile)));
  316.           if not (MaxFrame in [1..7]) then MaxFrame := 1;
  317.           PacLen := Word(str_int(ParmStr(2,Km,G^.DZeile)));
  318.           if not (PacLen in [1..FF]) then PacLen := FF;
  319.           ObStat := Byte(str_int(ParmStr(3,Km,G^.DZeile)));
  320.           UnStat := Byte(str_int(ParmStr(4,Km,G^.DZeile)));
  321.           UmlautMerk := Byte(str_int(ParmStr(5,Km,G^.DZeile)));
  322.           if not (UmlautMerk in UmlMenge) then UmlautMerk := 0;
  323.         end;
  324.  
  325.         MerkRead(Rrch + int_str(C) + ':RXS');
  326.         if G^.DZeile > '' then
  327.         begin
  328.           FRxName := G^.DZeile;
  329.           if OpenTextFile(C) then
  330.           begin
  331.             RX_Count := 0;
  332.             RX_Laenge := 0;
  333.             RX_Bin := 0;
  334.             RX_Save := true;
  335.             FTxName := G^.Drive;
  336.           end;
  337.         end else
  338.         begin
  339.           FRxName := G^.SavePfad + TxtName + SFillStr(3,'0',int_str(C));
  340.           FTxName := G^.SavePfad;
  341.         end;
  342.  
  343.         MerkRead(Rrch + int_str(C) + ':SAV');
  344.         if G^.DZeile > '' then
  345.         begin
  346.           SvName := G^.DZeile;
  347.           Assign(SFile,SvName);
  348.           Result := ResetBin(SFile,T);
  349.           if Result = 0 then Seek(SFile,FileSize(SFile))
  350.                         else Result := RewriteBin(SFile,T);
  351.           if Result = 0 then Save := true;
  352.         end else
  353.         begin
  354.           SvName := G^.SavePfad + SaveName + SFillStr(3,'0',int_str(C));
  355.         end;
  356.  
  357.         MerkRead(Rrch + int_str(C) + ':7PL');
  358.         if G^.DZeile > '' then
  359.         begin
  360.           Assign(SplFile,ParmStr(1,' ',G^.DZeile));
  361.           if ResetBin(SplFile,T) = 0 then
  362.           begin
  363.             Seek(SplFile,FileSize(SplFile));
  364.             SPlus := true;
  365.             SplSave := true;
  366.             Spl_gLaenge := LongInt(str_int(ParmStr(2,' ',G^.DZeile)));
  367.             Spl_gCount := LongInt(str_int(ParmStr(3,' ',G^.DZeile)));
  368.             Spl_tLaenge := LongInt(str_int(ParmStr(4,' ',G^.DZeile)));
  369.             Spl_tCount := LongInt(str_int(ParmStr(5,' ',G^.DZeile)));
  370.           end;
  371.         end;
  372.  
  373.  
  374.         MerkRead(Rrch + int_str(C) + ':FLAG');
  375.         if G^.DZeile > '' then
  376.         begin
  377.           i := pos('E',G^.DZeile);
  378.           if i > 0 then
  379.           begin
  380.             inc(i);
  381.             Hstr := copy(G^.DZeile,i,1);
  382.             i := Byte(str_int(Hstr));
  383.             if i in [1..7] then Echo := i;
  384.           end;
  385.  
  386.           i := pos('U',G^.DZeile);
  387.           if i > 0 then
  388.           begin
  389.             inc(i);
  390.             Hstr := copy(G^.DZeile,i,1);
  391.             i := Byte(str_int(Hstr));
  392.             if i in [1..4] then Umlaut := i;
  393.           end;
  394.  
  395.           Gross := (pos('Y',G^.DZeile) = 0);
  396.  
  397.           if C > 0 then
  398.           begin
  399.             TopBox       := (pos('M',G^.DZeile) > 0);
  400.             Auto         := (pos('F',G^.DZeile) > 0);
  401.             RX_Beep      := (pos('∞',G^.DZeile) > 0);
  402.             morsen       := (pos('C',G^.DZeile) > 0);
  403.             TxBeepAck    := (pos('Q',G^.DZeile) > 0);
  404.             Speek        := (pos('P',G^.DZeile) > 0);
  405.             AutoBin      := (pos('$',G^.DZeile) > 0);
  406.             SPlus        := (pos('+',G^.DZeile) > 0);
  407.             TxComp       := (pos('°',G^.DZeile) > 0);
  408.             RxComp       := (pos('≈',G^.DZeile) > 0);
  409.             NoCurJump    := (pos('÷',G^.DZeile) > 0);
  410.           end else
  411.           begin
  412.             Klingel      := (pos('K',G^.DZeile)  > 0);
  413.             CtrlBeep     := (pos('G',G^.DZeile)  > 0);
  414.             Time_Stamp   := (pos('T',G^.DZeile)  > 0);
  415.             PacOut       := (pos('L',G^.DZeile)  > 0);
  416.             ZeigeRET     := (pos('R',G^.DZeile)  > 0);
  417.             ConMorsen    := (pos('O',G^.DZeile)  > 0);
  418.             ReconMorsen  := (pos('D',G^.DZeile)  > 0);
  419.             ConVoice     := (pos('A',G^.DZeile)  > 0);
  420.             ReconVoice   := (pos('J',G^.DZeile)  > 0);
  421.             GlobalTrenn  := (pos('H',G^.DZeile)  > 0);
  422.             BinOut       := (pos('i',G^.DZeile)  > 0);
  423.             Ins          := (pos('Z',G^.DZeile)  > 0);
  424.             NoBinMon     := (pos('!',G^.DZeile)  > 0);
  425.             RX_TX_Win    := (pos('&',G^.DZeile)  > 0);
  426.           end;
  427.         end;
  428.       end;
  429.     end;
  430.  
  431.     MerkRead(Rrgl + Rsetl);
  432.     if G^.DZeile > '' then
  433.     begin
  434.       for i := 1 to 10 do G^.SETL[i] := Word(str_int(ParmStr(i,Km,G^.DZeile)));
  435.       SETNr := Byte(str_int(ParmStr(11,Km,G^.DZeile)));
  436.       if not (SETNr in [1..10]) then SETNr := 1;
  437.     end;
  438.  
  439.     MerkRead(Rrgl + Ridle);
  440.     if G^.DZeile > '' then
  441.     begin
  442.       Idle_Pos := copy(G^.DZeile,1,1) = '1';
  443.       Idle_Anz := Word(str_int(ParmStr(2,Km,G^.DZeile)));
  444.       Idle_Tout := Word(str_int(ParmStr(3,Km,G^.DZeile)));
  445.     end;
  446.  
  447.     MerkRead(Rrgl + Rmfreq);
  448.     if G^.DZeile > '' then G^.TonHoehe := Word(str_int(G^.DZeile));
  449.  
  450.     MerkRead(Rrgl + Rega);
  451.     if G^.DZeile > '' then _VGA := copy(G^.DZeile,1,1) = '1';
  452.  
  453.     MerkRead(Rrgl + Rplen);
  454.     if G^.DZeile > '' then MPause := Word(str_int(G^.DZeile));
  455.  
  456.     MerkRead(Rrgl + Rsynch);
  457.     if G^.DZeile > '' then Resync_Z := Word(str_int(G^.DZeile));
  458.  
  459.     MerkRead(Rrgl + Rcnr);
  460.     if G^.DZeile > '' then CNr := LongInt(str_int(G^.DZeile));
  461.  
  462.     MerkRead(Rrgl + Rvsp);
  463.     if G^.DZeile > '' then VSpeed := Word(str_int(G^.DZeile));
  464.  
  465.     MerkRead(Rrgl + Rinfo);
  466.     if G^.DZeile > '' then G^.InfoStr := G^.DZeile else G^.InfoStr := '';
  467.  
  468.     FiResult := CloseTxt(G^.TFile);
  469.   end else   (* If IOResult ... *)
  470.   begin
  471.     for i := 0 to maxLink do with K[i]^ do
  472.     begin
  473.       FRxName := G^.Drive + Txt + int_str(i) + Ext;
  474.       FTxName := G^.Drive;
  475.     end;
  476.   end;
  477. End;
  478.